package com.example.nio.dao;


import com.example.nio.commons.Agent;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AgentMapper {
    /**
     * 添加
     * @param agent
     * @return  int
     * @throws Exception
     */
    int add(Agent agent) throws Exception;

    /**
     * 修改
     * @param agent
     * @return  int
     * @throws Exception
     */
    int modify(Agent agent) throws Exception;

    /**
     * 遍历
     * @return  List<PublicAddress>
     * @throws Exception
     */
    List<Agent> getAgentList() throws Exception;

    /**
     * 根据提供列名查询
     * @param agent
     * @return  PublicAddress
     * @throws Exception
     */

    Agent getAgentByColumn(@Param("agent")String agent) ;



    String getAliasByUserId(@Param("userId")String userId);

    int addAliasName(@Param("userId")String userId,@Param("aliasName")String aliasName);

    int updateAliasName(@Param("userId")String userId,@Param("aliasName")String aliasName);

}
